import http from "@/utils/http";
import {TLBY_PC_WB} from "@/common/const";


const href = window.location.href;
const matchb = href.match(/token=([A-Za-z0-9,_.]{1,})/);
const matcha = href.match(/productId=(\d+)/);
var _token = matchb ? matchb[1] : "";
var _id = matcha ? matcha[1] : "";
var productId = window.localStorage.getItem("productId");
var id = _id || productId;
// console.log("_token",_token);

// 直播预告
export const getNoticeList = async (params) => {
  const url = `${TLBY_PC_WB}/client/queryMarketLiveList.htm`;
  const send = {
    // productId: id,
    productId: id==69?63:id,
    ...params,
  };
  return http.get(url,send);
};

// 录播栏目
export const queryVideoConfig = async () => {
  const url = `${TLBY_PC_WB}/client/queryVideoConfig.htm`;
  const params = {
    // productId: id,
    productId: id==69?63:id,
    channelName: "", //栏目名称
  };
  return http.get(url, params);
};

// 录播视频
export const queryRecordliveList = async (params) => {
  const url = `${TLBY_PC_WB}/client/queryRecordChargeLiveList.htm`;
  const send = {
    // productId: id,
    productId: id==69?63:id,
    clientCentralToken: _token,
    pageSize: 10,
    currentPage: params.currentPage,
    ...params,
  };
  return http.get(url, send);
};
